package niuke;

import java.util.Arrays;
import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int result = getResult(str);
        System.out.println(result);

    }

    private static int getResult(String str) {
        // 1. 先判断字符串中是否不包含字符o
        if(!str.contains("o")){
            return str.length();
        }
        // 2. 判断字符串中是否包含两个o
        if(isTwo(str) == 2){
            return str.length();
        }
        // 3. 当字符串里面的o字符出现两次以上时
        int result = calc(str);
        return result;
    }

    private static int calc(String str) {
        char[] chars = str.toCharArray();
        int oNum = isTwo(str);
        int[] tempArr = new int[oNum];
        String tempStr = "";
        for (int i = 0; i < chars.length; i++) {
            if((chars[i]+"").equals("o")){
                tempStr+=i;
            }
        }
        char[] chars1 = tempStr.toCharArray();
        int[] resultArr = new int[oNum];
        for (int i = 0; i < chars1.length; i++) {
            //resultArr[i] = str.length() - Integer.parseInt(chars1[i]+"");
            resultArr[i] = str.length() - Math.abs(chars1[i] - chars1[(i+2)%3]);
        }
        Arrays.sort(resultArr);
        return resultArr[resultArr.length-1];
    }

    private static int isTwo(String str) {
        char[] chars = str.toCharArray();
        int result = 0;
        for (char aChar : chars) {
            if((aChar+"").equals("o")){
                result++;
            }
        }
        return result;
    }


}
